package com.xbongbong.saas.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.pojo.dto.FormDataAddGetDTO;
import com.xbongbong.paas.pojo.dto.FormDataGetDTO;
import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.pojo.dto.ValidateDataDTO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.applist.pojo.vo.ListAppVO;
import com.xbongbong.pro.businessdata.pojo.dto.FormatExplainDTO;
import com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO;
import com.xbongbong.pro.webdetail.pojo.dto.WorkReportTargetThroughDTO;
import com.xbongbong.pro.webdetail.pojo.vo.WorkReportDetailVO;
import com.xbongbong.pro.webdetail.pojo.vo.WorkReportTargetThroughVO;
import com.xbongbong.pro.webexport.dto.WorkReportExportDTO;
import com.xbongbong.pro.weblist.pojo.WorkReportPojo;
import com.xbongbong.pro.weblist.pojo.dto.WorkReportListDTO;
import com.xbongbong.pro.weblist.pojo.dto.WorkReportStatisicAppDTO;
import com.xbongbong.pro.weblist.pojo.dto.WorkReportStatisicDTO;
import com.xbongbong.pro.weblist.pojo.dto.WorkReportUserStatisicDTO;
import com.xbongbong.pro.weblist.pojo.vo.WorkReportStatisicVO;
import com.xbongbong.pro.weblist.pojo.vo.WorkReportUserStatisicVO;
import com.xbongbong.pro.weblist.pojo.vo.WorkReportVO;
import com.xbongbong.pro.weblist.pojo.vo.WorkReportVisibleRangeVO;
import com.xbongbong.pro.workreport.pojo.dto.WorkReportDeleteBatchDTO;
import com.xbongbong.pro.workreport.pojo.dto.WorkReportPushRemindDTO;
import com.xbongbong.pro.workreport.pojo.vo.WorkReportDeleteBatchVO;
import com.xbongbong.pro.workreport.pojo.vo.WorkReportDetailStatisticsVO;
import com.xbongbong.pro.workreport.pojo.vo.WorkReportPushRemindVO;
import com.xbongbong.saas.domain.entity.WorkPlanEntity;
import com.xbongbong.saas.domain.entity.ext.WorkReportEntityExt;

import java.util.List;

/**
 * @author long.rao
 * @version v1.0
 * @date 2019/1/22 10:42
 * @since v1.0
 */
public interface WorkReportService {
    /**
     * Description: 工作报告保存前校验
     * @param validateDataDTO saas特殊校验数据入参
     * @throws XbbException 业务异常
     * @author long.rao
     * @date 2019-01-22 10:43
     */
    void beforeSave(ValidateDataDTO validateDataDTO) throws XbbException;
    /**
     * Description: 工作报告保存后逻辑
     * @param saasFormSaveDTO saas保存数据
     * @throws XbbException 业务异常
     * @author long.rao
     * @date 2019-01-22 10:44
     */
    void afterSave(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;


    /**
     * 新建时格式化解释
     *
     * @param formatExplainDTO 入参
     * @throws XbbException 异常
     * @author long.rao
     * @date 2019-02-13 20:53
     */
    void formatAddExplain(FormatExplainDTO formatExplainDTO) throws XbbException;

    /**
     * 工作报告是否已存在
     * @param formDataAddGetDTO
     * @return 数据id
     * @throws XbbException
     */
    WorkReportEntityExt getWorkReport(FormDataAddGetDTO formDataAddGetDTO) throws  XbbException;

    /**
     * 工作报告统计
     * @param workReportStatisicDTO
     * @return
     */
    WorkReportStatisicVO statisticsList(WorkReportStatisicDTO workReportStatisicDTO) throws XbbException;

    /**
     * 工作报告统计穿透
     * @param workReportUserStatisicDTO
     * @return
     * @throws XbbException
     */
    WorkReportUserStatisicVO userStatisticsList(WorkReportUserStatisicDTO workReportUserStatisicDTO) throws XbbException;

    /**
     * 工作报告详情
     * @param formDataGetDTO
     * @return
     * @throws XbbException
     */
    WorkReportDetailVO detail(FormDataGetDTO formDataGetDTO) throws XbbException;

    /**
     * 工作报告未读提醒
     * @param formDataGetDTO
     * @return
     * @throws XbbException
     */
    WorkReportPushRemindVO messageRemind(FormDataGetDTO formDataGetDTO) throws XbbException;

    /**
     * 工作报告权限范围
     * @param baseDTO
     * @return
     */
    WorkReportVisibleRangeVO visibleRange(BaseDTO baseDTO) throws XbbException;

    /**
     * 工作报告列表
     * @param workReportListDTO
     * @return
     */
    WorkReportVO workReportList(WorkReportListDTO workReportListDTO) throws XbbException;

    /**
     * 工作报告详情统计穿透
     * @param workReportTargetThroughDTO
     * @return
     */
    WorkReportTargetThroughVO targetThrough(WorkReportTargetThroughDTO workReportTargetThroughDTO) throws XbbException;
    /**
     * 格式化移动端列表页
     *
     * @param workReportListDTO 前端传参
     * @param esEntities 集合
     * @param totalCount 总数
     * @return ListAppVO
     * @throws XbbException
     * @author long.rao
     * @date 2019-03-11 13:50
     */
    ListAppVO formatWorkReportAppList(WorkReportListDTO workReportListDTO, List<WorkReportPojo> esEntities, Integer totalCount) throws XbbException;

    /**
     * 批量删除
     * @author 吴峰
     * @date 2019/3/25 15:36
     * @param workReportDeleteBatchDTO
     * @return com.xbongbong.pro.workreport.pojo.vo.WorkReportDeleteBatchVO
     * @throws XbbException 业务异常
     */
    WorkReportDeleteBatchVO deleteBatch(WorkReportDeleteBatchDTO workReportDeleteBatchDTO) throws XbbException;

    /**
     * 详情获取工作报告统计
     *
     * @param businessType 日报业务类型
     * @param userId 操作人id
     * @param corpid 公司id
     * @param reportTime 报告时间
     * @param statisticContent 统计文本
     * @return WorkReportDetailStatisticsVO
     */
    WorkReportDetailStatisticsVO getStatistic(Integer businessType, String userId, String corpid, Integer reportTime, String statisticContent) throws XbbException;

    /**
     * 工作报告导出数据
     *
     * @param workReportExportDTO 入参
     * @return excel
     * @throws XbbException 异常
     */
    PaasFormDataEsListVO exportList(WorkReportExportDTO workReportExportDTO) throws XbbException;

    /**
     * 一键提醒发送报告
     *
     * @param workReportPushRemindDTO 入参
     * @throws
     * @return
     * @author hongxiao
     * @date 2019-11-13 20:51
     * @since
     * @version
     */
    WorkReportPushRemindVO pushToAllNotSent(WorkReportPushRemindDTO workReportPushRemindDTO) throws XbbException;

    /**
     * 移动端获取工作报告统计
     * @param workReportStatisicAppDTO
     * @return
     */
    WorkReportStatisicVO statisticsAppList(WorkReportStatisicAppDTO workReportStatisicAppDTO) throws XbbException;

    void afterSaveForWorkflow(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    void afterSaveForUpdateWorkflow(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    WorkReportStatisicVO exportExcel(WorkReportStatisicDTO workReportStatisicDTO)throws XbbException;
}
